<?php $this->context->layout = 'form';?>
<?= \common\widgets\Asset::widget(['type' => ['summernote']]) ?>
<form class="form-horizontal m" id="form-admin-add">
    <?= \common\widgets\FormInput::widget(['name'=>'input','extend'=>['name'=>'id','type'=>'hidden','info'=>$info]])?>
    <?= \common\widgets\FormInput::widget(['name'=>'forminput|标题','extend'=>['name'=>'title','required'=>1,'info'=>$info]])?>
    <div class="form-group">
        <label class="col-sm-3 control-label">详情：</label>
        <div class="col-sm-8">
            <?= \common\widgets\FormInput::widget(['name' => 'textarea', 'extend' => ['height' => '500', 'name' => 'content', 'class' => 'summernote_content hide','value'=>$info['content']]]) ?>
            <div class="summernote" data-place="" data-height="400px"></div>
        </div>
    </div>
    <?= \common\widgets\FormInput::widget(['name'=>'forminput|排序','extend'=>['name'=>'sort','type'=>'number','tips'=>'排序值越大越靠前','info'=>$info]])?>
    <?= \common\widgets\FormInput::widget(['name'=>'formradio|状态','extend'=>['name'=>'status','required'=>1,'info'=>$info]])?>
</form>

<?php $this->beginBlock('script'); ?>
<script>
    function submitHandler() {
        if ($.validate.form()) {
            var sHTML = $('.summernote').summernote('code');
            $(".summernote_content").val(sHTML);
            $.operate.save(oesUrl, $('#form-admin-add').serialize());
        }
    }
</script>
<?php $this->endBlock(); ?>
